package com.weituotian.service.impl;

import com.weituotian.common.utils.PageInfo;
import com.weituotian.mapper.OperationMapper;
import com.weituotian.model.Operation;
import com.weituotian.service.IOperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 权限服务
 * Created by Administrator on 2016-09-30.
 */
@Service("operationService")
public class OperationService extends BaseService<Operation> implements IOperationService{

    private final OperationMapper operationMapper;

    @Autowired
    public OperationService(OperationMapper operationMapper) {
        this.operationMapper = operationMapper;
    }


    public void getList(PageInfo<Operation> pageInfo) {
        //排序
        Map<String, String> orderby = new HashMap<String, String>();
        orderby.put("id", "desc");
        pageInfo.setOrderby(orderby);

        pageInfo.setTotal(operationMapper.findPageCount(pageInfo));
        pageInfo.setList(operationMapper.findPageCondition(pageInfo));
    }

    public boolean add(Operation operation) {
        return false;
    }

    public boolean update(Operation operation) {
        return false;
    }

    public Operation findById(Integer id) {
        return null;
    }

    public boolean deleteById(Integer id) {
        return false;
    }
}
